import 'package:sainbainu/common/enums/gender.dart';

class UserProfileResponse {
  int? customerId;
  String? cover;
  String? uniqueNo;
  String? nickName;
  String? avatar;
  String? intro;
  int? gender;
  String? birthday;
  String? job;
  String? seatAddress;

  UserProfileResponse({
    this.customerId,
    this.cover,
    this.uniqueNo,
    this.nickName,
    this.avatar,
    this.intro,
    this.gender,
    this.birthday,
    this.job,
    this.seatAddress,
  });

  factory UserProfileResponse.fromJson(Map<String, dynamic> json) =>
      UserProfileResponse(
        customerId: json['customerId'] as int?,
        cover: json['cover'] as String?,
        uniqueNo: json['uniqueNo'] as String?,
        nickName: json['nickName'] as String?,
        avatar: json['avatar'] as String?,
        intro: json['intro'] as String?,
        gender: int.tryParse((json['gender'] as String?) ?? ''),
        birthday: json['birthday'] as String?,
        job: json['job'] as String?,
        seatAddress: json['seatAddress'] as String?,
      );

  Map<String, dynamic> toJson() => {
        'customerId': customerId,
        'cover': cover,
        'uniqueNo': uniqueNo,
        'nickName': nickName,
        'avatar': avatar,
        'intro': intro,
        'gender': gender,
        'birthday': birthday,
        'job': job,
        'seatAddress': seatAddress,
      };
}
